package make

import (
	"fmt"

	"github.com/spf13/cobra"
)

var Config = &cobra.Command{
	Use: "config",
	Short: "Create config file, example: make config mongodb",
	Run: runMakeConfig,
	Args: cobra.MinimumNArgs(1),
}

func runMakeConfig(cmd *cobra.Command, args []string) {
	for _, arg := range args {
		filePath := fmt.Sprintf("config/%s.go", arg)
		model := makeModelFromString(arg)
		createFileFromStub(filePath, "config", model)
	}
}
